const adminServ = require('../service/adminServ.js')

const adminCtrl = {
  deleteAdm : async (ctx)=>{
    let data = ctx.request.body
    await adminServ.deleteAdmServ(data)
    ctx.body = {
     code: 0,
     msg: 'success',
   }
  },
  addAdm:async (ctx) => {
    let data = ctx.request.body
    const res =  await adminServ.addAdmServ(data)
    ctx.body = {
      code: res.code,
      msg: res.msg,
    }
  },
  adminList:async (ctx) => {
    let data = ctx.request.body
    const  res =  await adminServ.selectAdmServ(data)
    ctx.body = {
      code: 0,
      msg: 'success',
      data : res
    }
  },
  editpwdWeb:async (ctx) => {
    let data = ctx.request.body
    await adminServ.editpwdWebServ(data)
    ctx.body = {
      code: 0,
      msg: 'success',
    }
  },
}

module.exports  = adminCtrl